package com.snail.common.dyd.bean;

import com.baomidou.dynamic.datasource.creator.DataSourceProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
public class DataSourceInfo extends DataSourceProperty {


    public DataSourceInfo() {
    }

    public DataSourceInfo(String id, Integer dbType, String url,String driverClassName, String username, String password) {
        this.id = id;
        this.dbType = dbType;
        setUrl(url);
        setDriverClassName(driverClassName);
        setUsername(username);
        setPassword(password);
    }

    public DataSourceInfo(Object dbSource) {
        if (dbSource != null) {
            BeanUtils.copyProperties(dbSource, this);
        }
    }


    private String id;
    private Integer dbType;
}
